﻿using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace Vision.Core.Entities.Activities
{
    /// <summary>
    /// 
    /// </summary>        
    [Serializable()]
    [DataContract()]
    public class VisionActivity : INotifyPropertyChanged
    {
		#region INotifyPropertyChanged implementation
		public event PropertyChangedEventHandler PropertyChanged;

		private void RaisePropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
		#endregion

		private string _name = null;

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public int Id { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public int FolderId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public string FolderPath { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public Guid Key { get; set; }

        /// <summary>
        /// 
        /// </summary>
		[DataMember]
		public string Name
		{
			get
			{
				return _name;
			}
			set
			{
				if (_name != value)
				{
					_name = value;
					RaisePropertyChanged("Name");
				}
			}
		}

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public string Description { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public XElement Activity { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public DateTime Created { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public DateTime Modified { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public VisionActivity()
        {
            this.Id = 0;
            this.FolderId = 0;
            this.Key = Guid.NewGuid();
        }
	}
}
